#include <iostream>
#include <vector>
using namespace std;
bool cmp(vector<int>& num1,vector<int>& num2)
{
	if(num1.size()!=num2.size())
		return num1.size()>num2.size();
	for(int i=num1.size()-1;i>=0;i--)
	{
		if(num1[i]!=num2[i])
		{
			return num1[i]>num2[i];
		}
	}
	return true;
}
void Sub(vector<int>& num1,vector<int>& num2,vector<int>& sum)
{
	int t=0;
	for(int i=0;i<num1.size();i++)
	{
		t=num1[i]-t;
		if(i<num2.size())
		{
			t-=num2[i];
		}
		sum.push_back((t+10)%10);
		if(t<0)
			t=1;
		else
			t=0;
	}
	
}
void Print(vector<int>& sum)
{
	int pos=sum.size()-1;
	while(pos>=0 && sum[pos]==0)
	{
		pos--;
	}
	
	if(pos==-1)
	{
		cout<<0<<endl;
	}
	while(pos>=0)
	{
		cout<<sum[pos--];
	}
}
int main()
{
	string t1,t2;
	cin>>t1>>t2;
	vector<int> num1,num2,sum;
	for(int i=t1.size()-1;i>=0;i--)
	{
		num1.push_back(t1[i]-'0');
	}
	for(int i=t2.size()-1;i>=0;i--)
	{
		num2.push_back(t2[i]-'0');
	}
	
	if(cmp(num1,num2))
	{
		Sub(num1,num2,sum);
		Print(sum);
	}
	else{
		Sub(num2,num1,sum);
		cout<<'-';
		Print(sum);
	}
	return 0;
}
